Among the many CPU functions in data processing systems are one or more tests which are performed on the data manipulated therein. The common denominator among the several tests which are performed on CPU data, particularly data associated with the ALU within the CPU is that such tests are performed upon the ALU "result". An ALU typically has two inputs to which operands are presensed and upon which the ALU performs one of several arithmetic or logical functions. The ALU "result" is the quantity which is presented at the output of the ALU as a result of the particular arithmetic or logical function which the ALU has been instructed by software to perform on the input operands.
The most typical test which is performed on the ALU result is the test ALU=0. This test examines the output of the ALU to determine whether in fact the ALU output is equal to zero. This test has assumed more than one form. In one commonly employed embodiment, the test allows masking of a subset of the bits forming one input to the ALU to ascertain whether a given bit field portion appearing on the other ALU input is equal to zero. To perform this test, a chosen portion of one input to the ALU is set with all logical "ones" while all other portions of the bit field of that input are "masked" or set to logical "zero".
In this manner, all of the bits of the other ALU input which correspond in bit position to the bits set to zero will, when logically ANDed to those bits, result in zero in that corresponding output bit position. Only those bits of the remaining unmasked bits (i.e., those bits not masked by a logical zero by the other ALU input) are effectively put to the test in the AND function, since they are logically combined with logical "ones". It is only if all of the "unmasked" bits are logical zero that the logical AND result out of the ALU will be equal to zero.
Another common use of this test is a loop counter routine wherein one input to the ALU is a value which is decremented in a subtract operation by the value placed on the other input to the ALU. After each decrement operation, the ALU result is tested to see if it is equal to zero. When the result is equal to zero, the loop counter routine is terminated.
These two aforementioned tests comprise the majority of tests which are performed on the ALU result in CPU operations involving the ALU.
While the performance of these tests has proven to be valuable to computer users for numerous reasons, there is an inherent characteristic of both tests which places a limitation on their utility. Both inputs to the ALU take a finite amount of time to propagate through the ALU in order to produce the result on which the test is performed. Furthermore, additional time is required for any borrow or carry operations which may affect the outcome of the tests.
There thus exists a need for a manner in which to perform these tests which does not involve the propagation time necessary to resolve the ALU inputs to an output result as an alternative to either stretching the clock cycle to permit the propagation of valuables through the ALU or by delaying the test by one clock cycle until the ALU results are available.